package org.example.upload.controller;

import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.annotation.MultipartConfig;
import java.io.IOException;

/**
 * 保存静态页面到静态服务器的接口
 */
@RequestMapping("/secKill")
@RestController
public class HtmlSaveController {

    @PostMapping("/{GoodsId}")
    public String saveSecKillHtml(@RequestParam("file") MultipartFile html, @PathVariable String GoodsId) throws IOException {
        //TODO
        byte[] bytes = html.getBytes();
        System.out.println(new String(bytes));

        return "save ok";
    }
}
